#include<stdio.h>
int main(){

    int a,b,c,i,j,n = 0,sum = 0;
    scanf("%d %d",&a,&b);

    if( a>b )
        {
           a = c;
           a = b;
           b = c;

            }


    for ( i=a;i<=b;i++ ){

        for ( j=2;j<i;j++ ) {
            if ( i%j==0) {

               n++;
            }
            if(n==0)
                sum = sum +i;
            }

        }
    printf("%d\n",sum);

return 0;
}

